package o;

import com.huawei.appgallery.assistantdock.buoydock.bean.GetGameBuoyEntryInfoResp;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.gamebox.plugin.gameservice.bean.GameInfo;
import java.util.List;

public class bfx {
    private GameInfo ˊ;
    private b ˋ;

    public interface b {
        void ˋ(boolean z);
    }

    public void ˎ(b bVar) {
        this.ˋ = bVar;
    }

    public bfx(GameInfo gameInfo) {
        this.ˊ = gameInfo;
    }

    public void ˏ() {
        cfw.ˎ(bfn.ˋ(this.ˊ), new IServerCallBack(this) {
            final /* synthetic */ bfx ˎ;

            {
                this.ˎ = r1;
            }

            public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
            }

            public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
                boolean z = false;
                GetGameBuoyEntryInfoResp getGameBuoyEntryInfoResp = (GetGameBuoyEntryInfoResp) responseBean;
                if (getGameBuoyEntryInfoResp.getResponseCode() == 0 && getGameBuoyEntryInfoResp.getRtnCode_() == 0) {
                    ezs.ˏ().ˏ(this.ˎ.ˊ, getGameBuoyEntryInfoResp);
                    if (getGameBuoyEntryInfoResp.ॱॱ() == 1) {
                        z = true;
                    }
                    eua.ˏ().ˋ("showByNewNotice", z);
                    if (azc.ˎ().ॱ() < 17) {
                        this.ˎ.ˋ();
                    }
                    if (this.ˎ.ˋ != null) {
                        this.ˎ.ˋ.ˋ(true);
                    }
                } else if (this.ˎ.ˋ != null) {
                    this.ˎ.ˋ.ˋ(false);
                }
            }
        });
    }

    private void ˋ() {
        if (!CollectCheck.isEmpty(bii.ˎ(this.ˊ))) {
            if (big.ˋ(this.ˊ)) {
                bit.ˋ().ˋ(this.ˊ.getPackageName());
            } else {
                bit.ˋ().ˊ(this.ˊ.getPackageName());
            }
            try {
                Logger.ˏ("GameBuoyEntryInfoGetter", "addGameSpacePackageList result is :" + Class.forName("com.huawei.android.app.ActivityManagerEx").getMethod("addGameSpacePackageList", new Class[]{List.class}).invoke(null, new Object[]{bit.ˋ().ˎ()}));
            } catch (Exception e) {
                Logger.e("GameBuoyEntryInfoGetter", "no such method");
            }
        } else if (Logger.ˎ()) {
            Logger.ˏ("GameBuoyEntryInfoGetter", "rom not support game mode");
        }
    }
}
